<?php
/**
 * @category 	DashDao.php
 * @author 		Sung Hoon, Cho (akdddnet@gmail.com)
 * @since		2011. 3. 3.
 * @license		BSD License
 * @version		0.1
 */
 
global $CFG;
require_once $CFG->FW_DIR."/mvc/Dao.php";
 
class DashDao extends Dao {
	
 	function __construct(array $db_type = null) {
 		parent::__construct($db_type);	
 	}
 	
 	function anniversary_list(DTO $dto) {
 		$query = "
 			SELECT 		*
 			FROM		anniversary
 			WHERE		1 = 1
 			ORDER BY 	ay_main DESC
 		";
 		
 		
 		$dto->list = $this->db->query($query)->fetchAll();
 		
 		return $dto;
 	}
 	
	function getLunarToSolar(DTO $dto) {
 		$query = "
 			SELECT 
 						* 
 			FROM 		lunartosolar 
 			WHERE		1 = 1
 			AND			lunar_date = :lunar_date
 		";
 		
 		$bind = array(
 			"lunar_date"=>$dto->obj
 		);
 		
 		$dto->obj = $this->db->query($query, $bind)->fetch();
 		
 		return $dto;
 	}
}